/* const express = require('express')
const app = express()

let mw = (req,res,next)=>{
    console.log('局部中间件----')
    next()
}

app.get('/', mw, (req,res)=>{
    res.send('express 局部中间件')
})

app.get('/home', (req,res)=>{
    res.send('express 局部中间件')
})

app.listen(8080,()=>{
    console.log('8080 running')
}) */

/* const express = require('express')
const app = express()

let mw = (req,res,next)=>{
    console.log('局部中间件----')
    next()
}

app.get('/', mw, (req,res)=>{
    res.send('express 局部中间件')
})

app.get('/home', (req,res)=>{
    res.send('express 局部中间件')
})

app.listen(8080,()=>{
    console.log('8080 running')
}) */

const express = require('express')
const app =  express()

let mw1 = (req,res,next)=>{
    console.log('局部中间件1')
    next()
}

let mw2 = (req,res,next)=>{
    console.log('局部中间件2')
    next()
}

app.get('/',(req,res)=>{
    res.send('get express')
})

app.get('/mw', [mw1,mw2],(req,res)=>{
    res.send('get express')
})

app.listen(8080,()=>{
    console.log('8080')
})